package com.imau.controller;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "ResponseServlet", value = "/ResponseServlet")
public class ResponseServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


        //处理响应 给客户端 浏览器 数据：使用输出流 字符
        //响应行 状态码 头 体
        response.setHeader("Content-Type","text/html;charset=utf-8");
        response.setStatus(200);
        //字符流
        response.getWriter().write("<h1>哈哈哈<h1>");


    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        this.doGet(request,response);
    }
}
